package com.mateng.treasurechest.model.recipe.service

import com.mateng.treasurechest.model.ServiceGenerator
import com.mateng.treasurechest.model.recipe.bean.CategoryBean
import com.mateng.treasurechest.model.recipe.bean.MenuSearchBean
import com.mateng.treasurechest.model.recipe.bean.RecipeDetailsBean
import retrofit2.http.GET
import retrofit2.http.Query
import rx.Observable

/**
 * Created by mateng on 2018/1/24.
 */
interface IRecipeService {

    companion object {
        private val SERVER_URL: String = "http://apicloud.mob.com/"
        val instance: IRecipeService
            get() {
                return ServiceGenerator.createService(IRecipeService::class.java, SERVER_URL)
            }
    }

    @GET("v1/cook/category/query")
    fun getCategory(@Query("key") key: String): Observable<CategoryBean>

    @GET("v1/cook/menu/search")
    fun getMenuSearch(@Query("key") key: String, @Query("cid") cid: String, @Query("name") name: String, @Query("page") page: Int, @Query("size") size: Int): Observable<MenuSearchBean>

    @GET("v1/cook/menu/query")
    fun getRecipeDetails(@Query("key") key: String, @Query("id") id: String): Observable<RecipeDetailsBean>
}